// Create the namespace
Training = {};
// Create a new class based on existing CompositeField
Training.Selection = CQ.Ext.extend(CQ.form.CompositeField, {
    text: "default text",
    constructor : function(config){
        if (config.text != null) this.text = config.text;
        var defaults = {
                height: "auto",
                border: false,
                style: "padding:0;margin-bottom:0;",
                layoutConfig: {
                    labelSeparator: CQ.themes.Dialog.LABEL_SEPARATOR
                },
                defaults: {
                    msgTarget: CQ.themes.Dialog.MSG_TARGET
                }
        };
        CQ.Util.applyDefaults(config, defaults);
        Training.Selection.superclass.constructor.call(this, config);
        this.selectionForm = new CQ.Ext.form.TimeField({
            name: this.name,
            hideLabel: true,
            anchor: "100%",
            minValue: '8:00am',
            maxValue: '6:00pm',
            
            intDate: new Date(),
            validateValue: function(value) {return true}
        });
        this.add(this.selectionForm);
    },
    processRecord: function(record, path){
        this.selectionForm.setValue(record.get(this.getName()));
    }
});
CQ.Ext.reg("trainingSelection", Training.Selection);